package mil.cdc.windows;

import java.awt.Color;
import java.awt.Toolkit;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.ScrollPaneConstants;

import mil.cdc.listeners.CustomMouseListener;
import mil.cdc.utils.CDCConstants;

import org.dyno.visual.swing.layouts.Bilateral;
import org.dyno.visual.swing.layouts.Constraints;
import org.dyno.visual.swing.layouts.GroupLayout;
import org.dyno.visual.swing.layouts.Leading;

//VS4E -- DO NOT REMOVE THIS LINE!
public class HowToWindow extends JFrame {

	private static final long serialVersionUID = 1L;
	private JTextArea jTextArea0;
	private JScrollPane jScrollPane0;
	private JButton jButton0;

	public HowToWindow() {
		initComponents();
	}

	private void initComponents() {
		setTitle("How To");
		setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("/mil/cdc/data/ico/af.gif")));
		setResizable(false);
		setLayout(new GroupLayout());
		add(getJScrollPane0(), new Constraints(new Bilateral(9, 12, 22), new Leading(10, 528, 10, 10)));
		add(getJButton0(), new Constraints(new Bilateral(358, 361, 81), new Leading(544, 12, 12)));
		setSize(800, 600);
	}

	private JButton getJButton0() {
		if (jButton0 == null) {
			jButton0 = new JButton();
			jButton0.setText("Close");
			jButton0.addMouseListener(new CustomMouseListener(this, CDCConstants.CLOSE));
		}
		return jButton0;
	}

	private JScrollPane getJScrollPane0() {
		if (jScrollPane0 == null) {
			jScrollPane0 = new JScrollPane();
			jScrollPane0.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
			jScrollPane0.setViewportView(getJTextArea0());
		}
		return jScrollPane0;
	}

	private JTextArea getJTextArea0() {
		if (jTextArea0 == null) {
			jTextArea0 = new JTextArea();
			jTextArea0.setLineWrap(true);
			jTextArea0.setText("jTextArea0");
			jTextArea0.setWrapStyleWord(true);
			jTextArea0.setEnabled(false);
			jTextArea0.setFocusable(false);
			jTextArea0.setDisabledTextColor(Color.black);
			jTextArea0.setText(getText());
		}
		return jTextArea0;
	}

	private String getText() {
		String message = "How to create your own tests:\n" +
				"There are two types of questions you can have\n" +
				"1)Question with 4 choices (used for practice test questions)\n 2)Question with one choice (used for review questions)\n" +
				"Also before each question group you can add a volume tag to separate the groups by volume. Note atleast one volume tag needs \n" +
				"to be included in the test.\n\nTo add a volume tag just add [volume<num>] before the questions and add[endvolume<num>] where \n" +
				"<num> is the volume number.\n\n" + 
				"Creating a question with 4 possibilities\n" +
				"-------------------------------------------------------------------\n"+
				"To format a question with 4 possibilities use the following format:\n" +
				"question:choice1:choice2:choice3:choice4:answer\n"+
				"Each element is separated by a colon. Answer is the number representing the correct choice\n\n"+
				"Creating a question with 1 answer\n" +
				"-------------------------------------------------------------------\n"+
				"To format a question with 1 answer use the following format:\n" +
				"question:choice1\n" +
				"-------------------------------------------------------------------\n" +
				"If you want to have the questions included with future releases of the software email the questions to locus2k@gmail.com\n" +
				"If you have any questions please email them to locus2k@gmail.com";
		return message;
	}

}
